set more off
capture log close
cd *** Fill in path name here ***

//  program:    AnanatEtAl_suicidality results - examining mobility
//  task:		Regressions of job losses on YRBS respondent characteristics

log using *** Fill in file name here ***, replace text

// #1
// Load data
use AnanatEtAl_suicidality_data.dta, clear

// #2
// Indicate data is weighted
svyset psu [pweight=weight], strata(stratum)  singleunit(certainty) 

// #3
// Run IV-probit regressions, predicting respondent characteristics from job loss, addressing the complex survey design

svy: ivprobit female (seppctyrlag = ticpctyrlag) yrd* std*
margins, dydx (seppctyrlag) predict (pr)

svy: ivprobit white (seppctyrlag = ticpctyrlag) yrd* std*
margins, dydx (seppctyrlag) predict (pr)

svy: ivprobit black (seppctyrlag = ticpctyrlag) yrd* std*
margins, dydx (seppctyrlag) predict (pr)

svy: ivprobit hisp (seppctyrlag = ticpctyrlag) yrd* std*
margins, dydx (seppctyrlag) predict (pr)

clear

log close
